<?php

namespace App\Models;

use App\Engine\BaseModel;
use Illuminate\Database\Eloquent\Model;

class ImageCategory extends BaseModel
{
    protected $fillable=['name','dir_name'];

    public static function insert_category($data)
    {
        $res=self::create($data);
        return $res;
    }

    public static function update_category($data)
    {
        $res=self::find($data['id'])->update($data);
        return $res;
    }

    public function img()
    {
        return $this->hasMany('App\Models\Image','category','id');
    }
}
